package org.distributed.transaction.core.context;

import java.util.HashMap;
import java.util.Map;

import org.distributed.transaction.core.annotion.PropagationStatus;
import org.distributed.transaction.core.enums.DTTransactionType;
import org.distributed.transaction.core.process.TransactionProcessor;
import org.springframework.stereotype.Component;

@Component
public class TransactionProcessorContext {

	public static Map<DTTransactionType, TransactionProcessor> transactionProcessorMap = new HashMap<DTTransactionType, TransactionProcessor>();

	/**
	 * @return
	 */
	public TransactionProcessor getTransactionProcessor(DTTransactionType transactionType, PropagationStatus propagationStatus) {
		return transactionProcessorMap.get(transactionType);
	}

}
